﻿#region Header
// ------------------------ Licence / Copyright ------------------------
// 
// ScrumTable for Scrum Meeting Support
// Copyright © HSR - Hochschule für Technik Rapperswil
// All Rights Reserved
// 
// Author:
//  Michael Gfeller Silvan Gehrig Patrick Boos
// 
// ---------------------------------------------------------------------
#endregion


#region Usings

using System.Windows;
using System.Windows.Media;

#endregion

namespace ScrumTable.UI.View.WinTouch.UserControls
{
    public enum AddButtonType
    {
        None,
        Story,
        Task,
        Bug,
        Attachment
    }

    /// <summary>
    /// Interaction logic for AddButton.xaml
    /// </summary>
    public partial class AddButton
    {
        #region Declarations
        //--------------------------------------------------------------------
        // Declarations
        //--------------------------------------------------------------------

        private AddButtonType _type = AddButtonType.None;

        #endregion

        #region Properties
        //--------------------------------------------------------------------
        // Properties
        //--------------------------------------------------------------------
        /// <summary>
        /// Sets the type of the button.
        /// </summary>
        /// <value>The type of the button.</value>
        public AddButtonType ButtonType
        {
            set
            {
                _type = value;
                switch (value)
                {
                    case AddButtonType.Story:
                        Background = (ImageBrush)Application.Current.Resources["IconAddUserStory"];
                        break;
                    case AddButtonType.Task:
                        Background = (ImageBrush)Application.Current.Resources["IconAddTask"];
                        break;
                    case AddButtonType.Bug:
                        Background = (ImageBrush)Application.Current.Resources["IconAddBug"];
                        break;
                    case AddButtonType.Attachment:
                        Background = (ImageBrush)Application.Current.Resources["IconAddAttachment"];
                        break;
                    default:
                        Background = (ImageBrush)Application.Current.Resources["IconAdd"];
                        break;
                }
            }
            get { return _type; }

        }
        #endregion

        #region Constructors / Destructor
        //--------------------------------------------------------------------
        // Constructors / Destructor
        //--------------------------------------------------------------------

        /// <summary>
        /// Initializes a new instance of the <see cref="AddButton"/> class.
        /// </summary>
        public AddButton()
        {
            InitializeComponent();
            Background = (ImageBrush)Application.Current.Resources["IconAdd"];
        }
        #endregion
    }
}
